<template>
  <el-select v-model="mcontract" placeholder="请选择媒介合同" @change="changeMcontract">
    <el-option
      v-for="item in list"
      :key="item.id"
      :label="item.title"
      :value="item.id">
    </el-option>
  </el-select>
</template>

<script>
    import Resource from '@/api/contract';
    const apiResource = new Resource('contract');
    export default {
        name: "Index",
        data() {
            return {
                list: [],
                mcontract:'',
            }
        },
        created() {
            this.getList()
        },
        methods:{
            async getList(){
                const { data } = await apiResource.getMcontract({});
                this.list=data;
            },
            changeMcontract(){
                this.$emit('func',this.mcontract)
            }
        }
    }
</script>

<style scoped>

</style>
